# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidDeviceProvisioning.V1.Model.Device do
  @moduledoc """
  An Android or Chrome OS device registered for zero-touch enrollment.

  ## Attributes

  *   `claims` (*type:* `list(GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceClaim.t)`, *default:* `nil`) - Output only. The provisioning claims for a device. Devices claimed for zero-touch enrollment have a claim with the type `SECTION_TYPE_ZERO_TOUCH`. Call `partners.devices.unclaim` or `partners.devices.unclaimAsync` to remove the device from zero-touch enrollment.
  *   `configuration` (*type:* `String.t`, *default:* `nil`) - Not available to resellers.
  *   `deviceId` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the device. Assigned by the server.
  *   `deviceIdentifier` (*type:* `GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceIdentifier.t`, *default:* `nil`) - The hardware IDs that identify a manufactured device. To learn more, read [Identifiers](https://developers.google.com/zero-touch/guides/identifiers).
  *   `deviceMetadata` (*type:* `GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceMetadata.t`, *default:* `nil`) - The metadata attached to the device. Structured as key-value pairs. To learn more, read [Device metadata](https://developers.google.com/zero-touch/guides/metadata).
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The API resource name in the format `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :claims => list(GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceClaim.t()) | nil,
          :configuration => String.t() | nil,
          :deviceId => String.t() | nil,
          :deviceIdentifier =>
            GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceIdentifier.t() | nil,
          :deviceMetadata =>
            GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceMetadata.t() | nil,
          :name => String.t() | nil
        }

  field(:claims, as: GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceClaim, type: :list)
  field(:configuration)
  field(:deviceId)
  field(:deviceIdentifier, as: GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceIdentifier)
  field(:deviceMetadata, as: GoogleApi.AndroidDeviceProvisioning.V1.Model.DeviceMetadata)
  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidDeviceProvisioning.V1.Model.Device do
  def decode(value, options) do
    GoogleApi.AndroidDeviceProvisioning.V1.Model.Device.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidDeviceProvisioning.V1.Model.Device do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
